package com.b.domain;

import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * 动态表
 */
@Document(indexName = "dynamic")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Dynamic {
    /**
     * 动态ID
     */
    @Id
    @Field(type = FieldType.Integer, index = true , store = true)
    private Integer id;

    /**
     * 发布者ID
     */
    @Field(type = FieldType.Integer, index = true , store = true)
    private Integer userId;

    /**
     * 标题
     */
    @Field(type = FieldType.Text, index = true , store = true, analyzer = "ik_max_word")
    private String title;

    /**
     * 内容
     */
    @Field(type = FieldType.Text, index = true , store = true, analyzer = "ik_max_word")
    private String content;

    /**
     * 点赞数
     */
    @Field(type = FieldType.Integer, index = true , store = true)
    private Integer likeCount;

    /**
     * 投币数
     */
    @Field(type = FieldType.Integer, index = true , store = true)
    private Integer coinCount;

    /**
     * 浏览量
     */
    @Field(type = FieldType.Integer, index = true , store = true)
    private Integer playCount;

    /**
     * 收藏量
     */
    @Field(type = FieldType.Integer, index = true , store = true)
    private Integer favoriteCount;

    /**
     * 评论总数
     */
    @Field(type = FieldType.Integer, index = true , store = true)
    private Integer commentCount;

    /**
     * 发布时间
     */
    @Field(type = FieldType.Date, index = false , store = true)
    private Date publishTime;
    /**
     * 类型
     */
    @Field(type = FieldType.Text, index = true , store = true)
    private String type;
}